home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / gfx / x11 / x3270_3_2_16.lha / amiga_src / arpa_telnet.h < prev    next >
C/C++ Source or Header  |  2009-02-27  |  5KB  |  121 lines

  1. /*    @(#)telnet.h 1.7 88/08/19 SMI; from UCB 5.1 5/30/85    */
  2. /*
  3.  * Copyright (c) 1983 Regents of the University of California.
  4.  * All rights reserved.  The Berkeley software License Agreement
  5.  * specifies the terms and conditions for redistribution.
  6.  */
  7.  
  8. /*
  9.  * Definitions for the TELNET protocol.
  10.  */
  11.  
  12. #ifndef _arpa_telnet_h
  13. #define _arpa_telnet_h
  14.  
  15. #define    IAC    255        /* interpret as command: */
  16. #define    DONT    254        /* you are not to use option */
  17. #define    DO    253        /* please, you use option */
  18. #define    WONT    252        /* I won't use option */
  19. #define    WILL    251        /* I will use option */
  20. #define    SB    250        /* interpret as subnegotiation */
  21. #define    GA    249        /* you may reverse the line */
  22. #define    EL    248        /* erase the current line */
  23. #define    EC    247        /* erase the current character */
  24. #define    AYT    246        /* are you there */
  25. #define    AO    245        /* abort output--but let prog finish */
  26. #define    IP    244        /* interrupt process--permanently */
  27. #define    BREAK    243        /* break */
  28. #define    DM    242        /* data mark--for connect. cleaning */
  29. #define    NOP    241        /* nop */
  30. #define    SE    240        /* end sub negotiation */
  31. #define EOR     239             /* end of record (transparent mode) */
  32. #define SUSP    237        /* suspend process */
  33. #define xEOF    236        /* end of file */
  34.  
  35. #define SYNCH    242        /* for telfunc calls */
  36.  
  37. #ifdef TELCMDS
  38. const char *telcmds[] = {
  39.     "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP",
  40.     "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT",
  41.     "IAC", 0
  42. };
  43. #endif
  44. #define TELCMD_FIRST    xEOF
  45. #define TELCMD_LAST    IAC
  46. #define    TELCMD_OK(x)    ((unsigned int)(x) <= TELCMD_LAST && \
  47.              (unsigned int)(x) >= TELCMD_FIRST)
  48. #define TELCMD(x)    telcmds[(x)-TELCMD_FIRST]
  49.  
  50. /* telnet options */
  51. #define TELOPT_BINARY    0    /* 8-bit data path */
  52. #define TELOPT_ECHO    1    /* echo */
  53. #define    TELOPT_RCP    2    /* prepare to reconnect */
  54. #define    TELOPT_SGA    3    /* suppress go ahead */
  55. #define    TELOPT_NAMS    4    /* approximate message size */
  56. #define    TELOPT_STATUS    5    /* give status */
  57. #define    TELOPT_TM    6    /* timing mark */
  58. #define    TELOPT_RCTE    7    /* remote controlled transmission and echo */
  59. #define TELOPT_NAOL     8    /* negotiate about output line width */
  60. #define TELOPT_NAOP     9    /* negotiate about output page size */
  61. #define TELOPT_NAOCRD    10    /* negotiate about CR disposition */
  62. #define TELOPT_NAOHTS    11    /* negotiate about horizontal tabstops */
  63. #define TELOPT_NAOHTD    12    /* negotiate about horizontal tab disposition */
  64. #define TELOPT_NAOFFD    13    /* negotiate about formfeed disposition */
  65. #define TELOPT_NAOVTS    14    /* negotiate about vertical tab stops */
  66. #define TELOPT_NAOVTD    15    /* negotiate about vertical tab disposition */
  67. #define TELOPT_NAOLFD    16    /* negotiate about output LF disposition */
  68. #define TELOPT_XASCII    17    /* extended ascic character set */
  69. #define    TELOPT_LOGOUT    18    /* force logout */
  70. #define    TELOPT_BM    19    /* byte macro */
  71. #define    TELOPT_DET    20    /* data entry terminal */
  72. #define    TELOPT_SUPDUP    21    /* supdup protocol */
  73. #define    TELOPT_SUPDUPOUTPUT 22    /* supdup output */
  74. #define    TELOPT_SNDLOC    23    /* send location */
  75. #define    TELOPT_TTYPE    24    /* terminal type */
  76. #define    TELOPT_EOR    25    /* end or record */
  77. #define TELOPT_TUID    26      /* TACACS user identification */
  78. #define TELOPT_OUTMRK    27      /* output marking */
  79. #define TELOPT_TTYLOC    28      /* terminal location number */
  80. #define TELOPT_3270REGIME 29    /* 3270 regime */
  81. #define TELOPT_X3PAD    30      /* X.3 PAD */
  82. #define TELOPT_NAWS     31      /* window size */
  83. #define TELOPT_TSPEED    32      /* terminal speed */
  84. #define TELOPT_LFLOW    33      /* remote flow control */
  85. #define TELOPT_LINEMODE 34      /* linemode option */
  86. #define TELOPT_XDISPLOC 35      /* X Display Location */
  87. #define TELOPT_OLD_ENVIRON 36   /* old - Environment variables */
  88. #define TELOPT_AUTHENTICATION 37/* authenticate */
  89. #define TELOPT_ENCRYPT    38      /* encryption option */
  90. #define TELOPT_NEW_ENVIRON 39   /* new - environment variables */
  91. #define TELOPT_TN3270E    40    /* extended 3270 regime */
  92. #define TELOPT_EXOPL    255    /* extended-options-list */
  93.  
  94. #define NTELOPTS    (1+TELOPT_TN3270E)
  95. #ifdef TELOPTS
  96. const char *telopts[NTELOPTS+1] = {
  97.     "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
  98.     "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
  99.     "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
  100.     "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
  101.     "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
  102.     "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
  103.     "TACACS UID", "OUTPUT MARKING", "TTYLOC",
  104.     "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
  105.     "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
  106.     "ENCRYPT", "NEW-ENVIRON", "TN3270E",
  107.     0
  108. };
  109. #define TELOPT_FIRST    TELOPT_BINARY
  110. #define TELOPT_LAST    TELOPT_TN3270E
  111. #define TELOPT_OK(x)    ((unsigned int)(x) <= TELOPT_LAST)
  112. #define TELOPT(x)    telopts[(x)-TELOPT_FIRST]
  113. #endif
  114.  
  115.  
  116. /* sub-option qualifiers */
  117. #define    TELQUAL_IS    0    /* option is... */
  118. #define    TELQUAL_SEND    1    /* send option */
  119.  
  120. #endif /*!_arpa_telnet_h*/
  121.